/*     */ package network;
/*     */ 
/*     */ import java.io.BufferedReader;
/*     */ import java.io.InputStreamReader;
/*     */ import java.io.PrintStream;
/*     */ import java.io.PrintWriter;
/*     */ import player.Move;
/*     */ import player.Player;
/*     */ 
/*     */ public class X3
/*     */ {
/*     */   public static final int xoox = 0;
/*     */   public static final int oxxo = 1;
/*     */   public static final int xooo = 2;
/*     */   public static final int xoxo = 3;
/*     */   public static final int oxox = 4;
/*  13 */   public int error = 0;
/*  14 */   public boolean oooo = false;
/*  15 */   public String xxoooName = null;
/*  16 */   public static boolean keyWait = false;
/*     */ 
/*  18 */   private static PrintWriter x7008 = null;
/*     */   private X2 xxo;
/*     */   private Player x9102;
/*     */   private Player x7075;
/*     */   private X4 oxo;
/*     */   private boolean x2117;
/*     */   private boolean x1030;
/*     */   private boolean x8321;
/*  27 */   private boolean x7041 = true;
/*  28 */   private boolean x2238 = true;
/*  29 */   private boolean x2159 = false;
/*     */ 
/*  31 */   private static double ooox = 0.0D;
/*  32 */   private static Player x3308 = null;
/*  33 */   private static Player x95o7 = null;
/*     */ 
/*     */   public static void xooxx(Player paramPlayer) {
/*     */   }
/*     */ 
/*     */   public static void setWait(boolean paramBoolean) {
/*  39 */     keyWait = paramBoolean;
/*     */   }
/*     */ 
/*     */   public static void oxxoo(Player paramPlayer) {
/*  43 */     if (x3308 == null)
/*  44 */       x3308 = paramPlayer;
/*     */     else
/*  46 */       x95o7 = paramPlayer;
/*     */   }
/*     */ 
/*     */   public X3(Player paramPlayer1, Player paramPlayer2, boolean paramBoolean) {
/*  50 */     this.x2117 = paramBoolean;
/*  51 */     this.xxo = new X2();
/*     */ 
/*  53 */     this.x9102 = paramPlayer1;
/*  54 */     this.x7075 = paramPlayer2;
/*     */ 
/*  56 */     oxxxx(paramPlayer1.myName + " is WHITE");
/*  57 */     oxxxx(paramPlayer2.myName + " is BLACK");
/*     */ 
/*  59 */     this.x1030 = ((paramPlayer1 == x3308) || (paramPlayer1 == x95o7));
/*  60 */     this.x8321 = ((paramPlayer2 == x3308) || (paramPlayer2 == x95o7));
/*     */ 
/*  62 */     if (this.x1030) oxxxx("WHITE is using vertical x coordinates");
/*  63 */     if (this.x8321) oxxxx("BLACK is using vertical x coordinates");
/*     */ 
/*  65 */     if (keyWait) {
/*     */       try {
/*  67 */         System.out.print("Hit return to continue: ");
/*  68 */         BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(System.in));
/*  69 */         String str = localBufferedReader.readLine();
/*     */       }
/*     */       catch (Exception localException)
/*     */       {
/*     */       }
/*     */     }
/*  75 */     if (paramBoolean) {
/*  76 */       this.oxo = new X4(this.xxo);
/*  77 */       if ((this.x9102 instanceof X6))
/*  78 */         ((X6)this.x9102).setFrame(this.oxo);
/*  79 */       if ((this.x7075 instanceof X6))
/*  80 */         ((X6)this.x7075).setFrame(this.oxo);
/*  81 */       this.oxo.show();
/*     */     }
/*     */   }
/*     */ 
/*     */   public X3(Player paramPlayer1, Player paramPlayer2, boolean paramBoolean, double paramDouble) {
/*  86 */     this(paramPlayer1, paramPlayer2, paramBoolean);
/*  87 */     ooox = paramDouble;
/*     */   }
/*     */ 
/*     */   private void oxxxx(String paramString) {
/*  91 */     if (this.x2117) System.out.println(paramString); 
/*     */   }
/*     */ 
/*     */   public boolean xooox()
/*     */   {
/*  95 */     return this.x2238;
/*     */   }
/*     */ 
/*     */   public void oxxxo() {
/*  99 */     Object localObject = null;
/* 100 */     if (this.x7041)
/* 101 */       ooxxo(this.x9102, this.x7075);
/*     */     else
/* 103 */       ooxxo(this.x7075, this.x9102);
/* 104 */     this.x7041 = (!this.x7041);
/*     */     X5 localX5;
/* 107 */     if ((localX5 = oxoxo(0)) != null)
/* 108 */       xxooo(this.x7075, false);
/* 109 */     if ((localX5 = oxoxo(1)) != null)
/* 110 */       xxooo(this.x9102, false);
/*     */   }
/*     */ 
/*     */   public void forceInitialMove() {
/* 114 */     if (this.x7041)
/* 115 */       forceInitialHelper(this.x9102, this.x7075);
/*     */     else
/* 117 */       forceInitialHelper(this.x7075, this.x9102);
/* 118 */     this.x7041 = (!this.x7041);
/*     */   }
/*     */ 
/*     */   public Move xxxoo(Move paramMove, Player paramPlayer) {
/* 122 */     if (((paramPlayer == this.x9102) && (this.x1030)) || ((paramPlayer == this.x7075) && (this.x8321)))
/*     */     {
/* 124 */       Move localMove = new Move(paramMove.y1, paramMove.x1, paramMove.y2, paramMove.x2);
/* 125 */       localMove.moveKind = paramMove.moveKind;
/* 126 */       return localMove;
/*     */     }
/* 128 */     return paramMove;
/*     */   }
/*     */ 
/*     */   private void xxooo(Player paramPlayer, boolean paramBoolean) {
/* 132 */     oxxxx(">>>> " + paramPlayer.myName + " <<<< WINS!\n");
/* 133 */     this.xxoooName = paramPlayer.myName;
/* 134 */     this.x2238 = false;
/*     */   }
/*     */ 
/*     */   private void forceInitialHelper(Player paramPlayer1, Player paramPlayer2)
/*     */   {
/* 140 */     Move localMove1 = new Move(1, 1);
/* 141 */     boolean bool = paramPlayer1.forceMove(localMove1);
/*     */ 
/* 143 */     if (!bool) {
/* 144 */       this.error += 2;
/* 145 */       oxxxx(paramPlayer1.myName + " would not accept the forceMove.");
/* 146 */       xxooo(paramPlayer2, true);
/*     */     }
/*     */ 
/* 149 */     Move localMove2 = xxxoo(localMove1, paramPlayer1);
/* 150 */     Move localMove3 = xxxoo(localMove2, paramPlayer2);
/*     */ 
/* 152 */     oxxxx(paramPlayer1.myName + " makes a move: " + localMove2);
/*     */ 
/* 154 */     if (!paramPlayer2.opponentMove(localMove3)) {
/* 155 */       this.oooo = true;
/* 156 */       oxxxx(paramPlayer2.myName + " accuses " + paramPlayer1.myName + " of cheating: " + localMove2);
/*     */     }
/*     */ 
/* 159 */     if (!ooxoo(localMove2, paramPlayer1)) {
/* 160 */       this.error += 4;
/* 161 */       oxxxx("Referee accuses " + paramPlayer1.myName + " of cheating.");
/* 162 */       xxooo(paramPlayer2, true);
/*     */     }
/*     */   }
/*     */ 
/*     */   private void ooxxo(Player paramPlayer1, Player paramPlayer2)
/*     */   {
/* 169 */     String str1 = paramPlayer1.getClass().getName();
/* 170 */     String str2 = paramPlayer2.getClass().getName();
/*     */ 
/* 172 */     long l1 = System.currentTimeMillis();
/* 173 */     Move localMove1 = paramPlayer1.chooseMove();
/* 174 */     long l2 = System.currentTimeMillis();
/* 175 */     if ((ooox > 0.0D) && (l2 - l1 > ooox * 1000.0D)) {
/* 176 */       this.error += 1;
/* 177 */       oxxxx(str1 + " is disqualified for taking too long.");
/* 178 */       xxooo(paramPlayer2, true);
/*     */     }
/* 180 */     if (localMove1 == null) {
/* 181 */       this.error += 2;
/* 182 */       oxxxx(paramPlayer1.myName + " returned a null move, quitting.");
/* 183 */       xxooo(paramPlayer2, true);
/*     */     }
/* 185 */     if (localMove1.moveKind == 0) {
/* 186 */       this.error += 3;
/* 187 */       oxxxx(paramPlayer1.myName + " quits the game.");
/* 188 */       xxooo(paramPlayer2, true);
/*     */     }
/*     */ 
/* 191 */     Move localMove2 = xxxoo(localMove1, paramPlayer1);
/* 192 */     Move localMove3 = xxxoo(localMove2, paramPlayer2);
/*     */ 
/* 194 */     oxxxx(paramPlayer1.myName + " makes a move: " + localMove2);
/*     */ 
/* 196 */     if (!paramPlayer2.opponentMove(localMove3)) {
/* 197 */       this.oooo = true;
/* 198 */       oxxxx(paramPlayer2.myName + " accuses " + paramPlayer1.myName + " of cheating: " + localMove2);
/*     */     }
/*     */ 
/* 201 */     if (!ooxoo(localMove2, paramPlayer1)) {
/* 202 */       this.error += 4;
/* 203 */       oxxxx("Referee accuses " + paramPlayer1.myName + " of cheating.");
/* 204 */       xxooo(paramPlayer2, true);
/*     */     }
/*     */   }
/*     */ 
/*     */   private boolean ooxoo(Move paramMove, Player paramPlayer)
/*     */   {
/*     */     boolean bool;
/* 210 */     if (paramPlayer == this.x9102)
/* 211 */       bool = this.xxo.xxxox(paramMove, 1);
/*     */     else
/* 213 */       bool = this.xxo.xxxox(paramMove, 0);
/* 214 */     if (this.x2117)
/* 215 */       this.oxo.xooo.ooxxx(paramMove);
/* 216 */     return bool;
/*     */   }
/*     */ 
/*     */   public X5 oxoxo(int paramInt) {
/* 220 */     X5 localX5 = this.xxo.oxoxo(paramInt);
/* 221 */     if ((localX5 != null) && (this.x2117))
/* 222 */       this.oxo.xooo.oxoox(localX5);
/* 223 */     return localX5;
/*     */   }
/*     */ 
/*     */   public void oooox() {
/* 227 */     System.out.print("Current xxo is:\n\n           ");
/* 228 */     String str = "";
/* 229 */     for (int i = 0; i < 8; i++) {
/* 230 */       System.out.print("        | ");
/* 231 */       for (int j = 0; j < 8; j++) {
/* 232 */         switch (this.xxo.oooxx(j, i)) { case 0:
/* 233 */           str = "B"; break;
/*     */         case 1:
/* 234 */           str = "W"; break;
/*     */         case 2:
/* 235 */           str = " "; break;
/*     */         case 3:
/* 236 */           str = "X";
/*     */         }
/* 238 */         System.out.print(str + " ");
/*     */       }
/* 240 */       System.out.print("|\n           ");
/*     */     }
/* 242 */     System.out.println("");
/*     */   }
/*     */ }

/* Location:           C:\Users\Justin\Desktop\pj2\
 * Qualified Name:     network.X3
 * JD-Core Version:    0.6.0
 */